POV-Ray : Newsgroups : povray.general : Normal scaling bug(s) ? : Normal scaling bug(s) ? Server Time
10 Aug 2024 23:26:49 EDT (-0400)
  Normal scaling bug(s) ?  
From: Rune S  Johansen
Date: 8 Oct 1999 18:10:59
Message: <37fe6bf3@news.povray.org>
/*
I keep being confused by these normals!

I consider it a bug that the depth of a normal
doesn't always proportionally follow the scaling
affecting the normal.

I think the problem is quite serious. Again and
again I find myself unable to work effectively
with normals because the way they work (regarding
scaling) just isn't logic but on the contrary
strange and very inconvenient!

If you consider it a bug too I think it should be
fixed.

I know it would break a whole lot of scenes, but
wouldn't it be possible to make some kind of
switch so the user could switch between the old
wrong method and a new proper one? Maybe the
already existing #version switch could be used
for that?

Below the problem is described in details.

Please note that I've found out more about the
problem since my last posts regarding normals so
I'm not just saying exactly the same again...! :-)

There are four basic types of normals:

o Block pattern normals (checker, hexagon, brick).
o Bump maps.
o Specialized normals (bumps, dents, ripples,
  waves, wrinkles).
o The rest is continuous pattern normals.

When working with normals you can modify both the
scale of the pattern and the depth of the pattern.

When you apply a *specialized normal* to an object
and afterwards scale the object smaller or larger,
the depth of the normal pattern follows the scale
of the pattern proportionally as you would expect.

However, when you apply a *continuous pattern
normal* to an object and scale the object smaller
or larger afterwards, the depth of the normal
pattern *doesn't* follow the scale of the pattern.
That is, if you scale the object smaller the
normal seems to be too deep and if you scale the
object larger the normal seems to be too flat.

If you want to have the depth of a *continuous
pattern normal* to follow the scale of the pattern
proportionally you must multiply the depth of the
normal pattern with the same amount you scale the
object with. However, for some reason that only
works when scaling the object larger, not when
scaling it smaller.

Just to confuse you even more: If you have an
*continuous pattern normal* inside a *normal_map*
it works as if it were a *specialized normal*,
that is, the depth of the normal pattern follows
the scale of the pattern proportionally. That's
what I just found out and that makes it all even
more confusing and inconvenient!

Here's an example of it all:

Left spheres:  Normal depth of 1.
Right spheres: Normal depth proportional to "Scale".
Upper spheres: A plain crackle normal.
Lower spheres: Same normal but inside a normal_map.

Change "Scale" to other values to see the effects.
*/

#declare Scale=1;

camera{location -8*z look_at 0 orthographic  scale Scale}
light_source{<1,1,-1>*100,color 1 shadowless scale Scale}
#default{pigment{color rgb 1}}

#declare N1a=normal{crackle 1    }
#declare N1b=normal{crackle Scale}

#declare N2a=normal{bozo normal_map{[0 N1a][1 N1a]}}
#declare N2b=normal{bozo normal_map{[0 N1b][1 N1b]}}

sphere{0,2 normal{N1a}translate <-2,+2,> scale Scale}
sphere{0,2 normal{N1b}translate <+2,+2,> scale Scale}
sphere{0,2 normal{N2a}translate <-2,-2,> scale Scale}
sphere{0,2 normal{N2b}translate <+2,-2,> scale Scale}


Post a reply to this message

Copyright 2003-2023 Persistence of Vision Raytracer Pty. Ltd.